/**
 * 
 */
package com.ez.supervise.service.impl;

import java.util.List;
import java.util.Map;

import com.ez.supervise.dao.PermissionDao;
import com.ez.supervise.model.sys.Permission;
import com.ez.supervise.service.PermissionService;

/**
 * @author searph.wang
 * @email searph.wang@gmail.com
 * @Created at 2009-7-22
 * 
 */
public class PermissionServiceImpl implements PermissionService {
    private PermissionDao permissionDao;

    // public int update(Permission permission) {
    // return sqlMapClientTemplate.update("sys.updatePermission", permission);
    // }

    public void setPermissionDao(PermissionDao permissionDao) {
	this.permissionDao = permissionDao;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.ez.supervise.service.base.BaseService#delete(java.lang.Long)
     */
    public void delete(Long id) {
	// TODO Auto-generated method stub
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.ez.supervise.service.base.BaseService#insert(java.lang.Object)
     */
    public void insert(Object entity) {
	permissionDao.insert(entity);

    }

    /*
     * (non-Javadoc)
     * 
     * @see com.ez.supervise.service.base.BaseService#update(java.lang.Object)
     */
    public void update(Object entity) {
	permissionDao.update(entity);
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.ez.supervise.service.base.BaseService#get(java.lang.Long)
     */
    public Object get(Long id) {
	return (Permission) permissionDao.get(id);
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.ez.supervise.service.PermissionService#findAll()
     */
    public List findAll() {
	return permissionDao.findAll();
    }

    /* (non-Javadoc)
     * @see com.ez.supervise.service.PermissionService#findAllMenu()
     */
    public Map<String, Permission> findAllMenu() {
	return permissionDao.findAllMenu();
    }

    /* (non-Javadoc)
     * @see com.ez.supervise.service.PermissionService#findAllSubMenu()
     */
    public Map<String, Permission> findAllSubMenu() {
	return permissionDao.findAllSubMenu();
    }

    /* (non-Javadoc)
     * @see com.ez.supervise.service.PermissionService#findPermission(java.lang.Long)
     */
    public List<Permission> findPermission(Long userId) {
	return permissionDao.findPermission(userId);
    }
}
